<div ng-controller="unitlistController">
    <div class="query_criteria">
        <div class="selece_tj">
            <p>
                <span>设备编号：<input class="laydate-icon" type="text" ng-model="code" placeholder="设备编号"/> </span>
                <span>公司名称：<input class="laydate-icon" type="text" ng-model="companyName" placeholder="公司名称"/> </span>
                <span>终端编号：<input class="laydate-icon" type="text" ng-model="unitZDcode" placeholder="终端编号"/> </span>
                <a class="unit-btnSelect" ng-click="getUnitList()"> 查 询</a>
            </p>
        </div>
    </div>

    <div class="queryDivBox">
        <div style="height: 40px;">
            <span style="margin-left: 20px; font-size: 14px;">全选：</span>
            <input type="checkbox" style="width: 16px; height: 16px;"
                   ng-model="selectAll" ng-click="all()">
            <input class="unit-btnSelect" id="Versionupdate" style="text-align: center; line-height: 30px; height: 30px; background:white"
                   type="button" value="版本更新"  data-toggle="modal" data-target="#ALLchoiseversion" ng-click="multiversion()">
        </div>
        <div class="query_table" style="height: 340px !important; overflow-y: auto;">
            <table class="table table-bordered table-striped">
                <tr>
                    <td>选择</td>
                    <td>终端编号</td>
                    <td>公司名称</td>
                    <td>所属实验室</td>
                    <td>设备编号</td>
                    <td>设备种类</td>
                    <td>操作</td>
                </tr>
                <tr ng-repeat="shebei in getdeviceslist">
                    <td><input type="checkbox" ng-model="shebei.checked" ng-click="radiochosse()" ></td>
                    <td ng-bind="shebei.monitorDevice.number"></td>
                    <td ng-bind="shebei.manager.companyName"></td>
                    <td ng-bind="shebei.roomName"></td>
                    <td ng-bind="shebei.code"></td>
                    <td ng-bind="shebei.deviceType.name"></td>
                    <td>
                        <a data-toggle="modal" data-target="#changeunit" ng-click="unitsaveDialog()">修改</a>
                        <a data-toggle="modal" data-target="#choiseversion" ng-click="versionchooseDialog()" style="margin: 0 10px;">更新</a>
                        <a data-toggle="modal" data-target="#changezero" ng-click="zerosaveDialog()">零漂设置</a>

                    </td>
                </tr>
            </table>

        </div>
        <div class="pagination datapager fr pr20">
            <ul>
                <li ng-class="{disabled: pageIndex == 0}"><a href="javascript:void(0)" ng-click="prevPage()">上一页</a>
                </li>
                <li ng-repeat="n in range(pageTotal)"
                    ng-class="{active: n == pageIndex}"
                    ng-click="setPage()">
                    <a href="javascript:void(0)" ng-bind="n + 1">1</a>
                </li>
                <li ng-class="{disabled: pageIndex == pageTotal - 1}"><a href="javascript:void(0)" ng-click="nextPage()">下一页</a></li>
                <li class="page_allShow"><a href="javascript:void(0)">共<span>{{total}}</span>条</a></li>
            </ul>

        </div>
    </div>

    <!-- 修改设备编号弹出框-->
    <div id="changeunit" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="deleteUnitLable" aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h4>修改终端编号</h4>
        </div>
        <div class="modal-body" style="min-height: 50px !important;">
            <div class="container" style="width:500px;">
                <div class="add_tj">
                    终端编号：<input type="text" ng-model="newunitnumber">
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">关 闭</button>
            <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true" ng-click="unitsave()">保 存</button>
        </div>
    </div>

    <!-- 修改漂零值弹出框-->
    <div id="changezero" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="deleteUnitLable" aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h4>修改漂零值</h4>
        </div>
        <div class="modal-body" style="min-height: 50px !important;">
            <div class="container" style="width:500px;">

                <div class="versionlist">
                    <table class="table table-bordered table-striped">
                        <tr>
                            <td style="text-align: center"><h5>序号</h5></td>
                            <td style="text-align: center"><h5>参数类型</h5></td>
                            <td style="text-align: center"><h5>测量原值</h5></td>
                            <td style="text-align: center"><h5>校正值</h5></td>
                            <td style="text-align: center"><h5>漂零值</h5></td>
                            <td style="text-align: center"><h5>操作</h5></td>
                        </tr>
                        <tr ng-repeat="unitzero in unitzerodata">
                            <td style="text-align: center">{{$index+1}}</td>
                            <td style="text-align: center" ng-bind="unitzero.inspectType.name"></td>
                            <td style="text-align: center" ng-bind="unitzero.originalValue"></td>
                            <td style="text-align: center" ng-bind="unitzero.correctionValue"></td>
                            <td style="text-align: center"><input type="text" ng-model="unitzero.zero"></td>
                            <td style="text-align: center"><a style="cursor: pointer" ng-click="zerosave()">保 存</a></td>
                        </tr>

                    </table>
                </div>

            </div>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">关 闭</button>
            <!--<button class="btn btn-primary" data-dismiss="modal" aria-hidden="true" ng-click="zerosave()">保 存</button>-->
        </div>
    </div>


    <!-- 全选版本选择弹出框-->
    <div id="ALLchoiseversion" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="deleteUnitLable" aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h4>选择更新版本</h4>
        </div>
        <div class="modal-body" style="min-height: 50px !important;">
            <div class="container" style="width:500px;">
                <div class="versionlist">
                    <table class="table table-bordered table-striped">
                        <tr>
                            <td style="text-align: center"><h5>版本选择</h5></td>
                            <td style="text-align: center"><h5>版本名称</h5></td>
                            <td style="text-align: center"><h5>版本号1</h5></td>
                            <td style="text-align: center"><h5>版本号2</h5></td>
                            <td style="text-align: center"><h5>版本号3</h5></td>
                            <td style="text-align: center"><h5>版本号4</h5></td>
                        </tr>
                        <tr ng-repeat="version in versionlist">
                            <td style="text-align: center"><input type="radio" name="deviceVersionId" style="width: 18px;height: 18px;" ng-click="checkboxid()"></td>
                            <td style="text-align: center" ng-bind="version.name"></td>
                            <td style="text-align: center" ng-bind="version.firstCode"></td>
                            <td style="text-align: center" ng-bind="version.secondCode"></td>
                            <td style="text-align: center" ng-bind="version.thirdCode"></td>
                            <td style="text-align: center" ng-bind="version.forthCode"></td>
                        </tr>

                    </table>
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">关 闭</button>
            <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true" ng-click="ALLversionchoose()">保 存</button>
        </div>
    </div>


    <!-- 版本选择弹出框-->
    <div id="choiseversion" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="deleteUnitLable" aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h4>选择更新版本</h4>
        </div>
        <div class="modal-body" style="min-height: 50px !important;">
            <div class="container" style="width:500px;">
                <div class="versionlist">
                    <table class="table table-bordered table-striped">
                        <tr>
                            <td style="text-align: center"><h5>版本选择</h5></td>
                            <td style="text-align: center"><h5>版本名称</h5></td>
                            <td style="text-align: center"><h5>版本号1</h5></td>
                            <td style="text-align: center"><h5>版本号2</h5></td>
                            <td style="text-align: center"><h5>版本号3</h5></td>
                            <td style="text-align: center"><h5>版本号4</h5></td>
                        </tr>
                        <tr ng-repeat="version in versionlist">
                            <td style="text-align: center"><input type="radio" name="deviceVersionId" style="width: 18px;height: 18px;" ng-click="checkboxid()"></td>
                            <td style="text-align: center" ng-bind="version.name"></td>
                            <td style="text-align: center" ng-bind="version.firstCode"></td>
                            <td style="text-align: center" ng-bind="version.secondCode"></td>
                            <td style="text-align: center" ng-bind="version.thirdCode"></td>
                            <td style="text-align: center" ng-bind="version.forthCode"></td>
                        </tr>

                    </table>
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">关 闭</button>
            <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true" ng-click="versionchoose()">保 存</button>
        </div>
    </div>
</div>